<ul class="list-unstyled category-list">
    {% for category in categories %}
    <li class="category">
        {%  set categoryUrl = path('category_view', {'slug': category.slug}) %}
        <a href="{{ categoryUrl }}" class="cover">
            <img src="{{ category.cover|imagine_filter('middle_square') }}" class="media img-responsive"/>
        </a>
        <a href="{{ categoryUrl }}" class="name">{{ category.name }}</a>
    </li>
    {% endfor %}
    {% if categories|length < 2 and app.user is same as (user) %}
    <li class="add-new-category"><a href="{{ path('category_add') }}"><i class="if i-plus"></i> 创建新专栏</a></li>
    {% endif %}
</ul>